<?php
// +----------------------------------------------------------------------
// | QSCMS
// +----------------------------------------------------------------------
// | Copyright (c)  2025 https://www.qqss.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed QSCMS is not free software, commercial use must purchase official license from official website to avoid unnecessary legal disputes.
// +----------------------------------------------------------------------
// | Author: Contract 990504246@qq.com
// +----------------------------------------------------------------------

namespace app\adminapi\validate\setting;

use taoser\Validate;

class CollectionValidate extends Validate
{
    protected $rule = [
        'title'          => 'require',
        'code'           => 'require',
        'show_name'      => 'require',
        'account_fields' => 'require',
    ];

    protected $message = [
        'title.require'          => 'collection_name_required',
        'code.unique'            => 'collection_code_required',
        'show_name.require'      => 'collection_show_name_required',
        'account_fields.require' => 'collection_account_fields_required',
    ];

    public function sceneCollection()
    {
        return $this->only(['title', 'code', 'show_name', 'account_fields']);
    }

    public function sceneSettlement()
    {
        return $this->only(['title', 'code', 'account_fields']);
    }
}